#!/bin/bash
loadFlannelImages(){

cd ../soft

tar -zxvf ./kube-flannel.tar.gz


ls ./flannel.images > /tmp/image-list.txt

cd ./flannel.images

for i in $(cat /tmp/image-list.txt)

do 
    docker load -i $i
done

rm -rf ./image-list.txt
}

startFlannel(){
	cd ../../script/flannel
	kubectl create -f kube-flannel.yml
}

main(){
  loadFlannelImages
  startFlannel
}
main